package com.tul.exercise.base.java8.stream.filter;

import com.tul.exercise.base.java8.stream.base.Artist;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.util.List;

/**
 * Stream的filter方法使用示例
 *
 * @author tuliang
 */
public class FilterTest {

    @Test
    @DisplayName("filter()方法")
    public void test01() {
        List<Artist> artists = Artist.createArtists(10);
        // 过滤出男人
        artists.stream().filter(Artist::isMam).forEach(System.out::println);



    }
}
